<?php

/**
 * Implementation of hook_theme()
 */
function wowguild_theme() {
  return array(
    'wowcharsheet_guild_members' => array(
      'template' => 'wowguild-manage-guild-members',
      'arguments' => array('guild' => NULL),
    ),
  );
}

function template_preprocess_wowguild_manage_guild_members(&$variables) {
  $class = _wowcharsheet_get_constant('classId');
	$gender = _wowcharsheet_get_constant('genderId');
	$race = _wowcharsheet_get_constant('raceId');
	$faction = _wowcharsheet_get_constant('factionId');
  // Load toon details
  for($i=0;$i<count($variables['guild']->members);$i++) {
		$variables['guild']->members[$i]['class'] = $class[$variables['guild']->members[$i]['classId']];
		$variables['guild']->members[$i]['gender'] = $gender[$variables['guild']->members[$i]['genderId']];
		$variables['guild']->members[$i]['race'] = $race[$variables['guild']->members[$i]['raceId']];
		$variables['guild']->members[$i]['faction'] = $faction[$variables['guild']->members[$i]['factionId']];
	}
}
